<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<sec:authentication property="principal" var="currentPrincipal" scope="page"/>

<fmt:setBundle basename="ApplicationMessage"/>
<fmt:setLocale value="zh_CN"/>

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp" %>
  <%@ include file="/WEB-INF/include/css.jsp" %>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp" %>
  <%@ include file="/WEB-INF/include/submenu.jsp" %>
  
  <div class="container-fluid ms-container has-ms-sidemenu">
  
    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">个人中心 &nbsp;&nbsp;-&nbsp;&nbsp;基本信息</li>
    </ol>
  
    <div class="ms-content-layout">
  
      <div class="form-horizontal ms-form form-personal-info">
      
        <div class="block-heading">
          <h5>基本信息</h5>
          <div class="pull-right" style="margin-top: 10px">
  	        <a href="${ctx.host}/profile/${profile.id}/edit-password" data-target="#edit-password" data-toggle="modal">修改密码</a>&nbsp;
          </div>
        </div>
  
        <div class="form-horizontal ms-form form-personal-info">
  
          <div class="form-group ms-form-group">
            <label class="control-label col-xs-2" style="width: 12%;">登录名：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${profile.loginName}</p>
            </div>
  
            <label class="control-label col-xs-2" style="width: 12%;">角色：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${secure.roles[profile.authority].name}</p>
            </div>
          </div>
  
          <div class="form-group ms-form-group">
            <label class="control-label col-xs-2" style="width: 12%;">姓名：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${profile.name}</p>
            </div>
  
            <label class="control-label col-xs-2" style="width: 12%;">性别：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${profile.gender}</p>
            </div>
          </div>
          
          <c:if test="${login.supplier}">
  	        <div class="form-group ms-form-group">
  	          <label class="control-label col-xs-2" style="width: 12%;">供应商代码：</label>
  	          <div class="col-xs-2">
  	            <p class="form-control-static">${persist.supplier(profile.supplierId).code}</p>
  	          </div>
  	          
  	          <label class="control-label col-xs-2" style="width: 12%;">供应商名称：</label>
  	          <div class="col-xs-2">
  	            <p class="form-control-static">${persist.supplier(profile.supplierId).name}</p>
  	          </div>
  	        </div>
          </c:if>
  
          <div class="form-group ms-form-group">
            <label class="control-label col-xs-2" style="width: 12%;">联系电话：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${profile.mobile}</p>
            </div>
  
            <label class="control-label col-xs-2" style="width: 12%;">联系地址：</label>
            <div class="col-xs-2">
              <p class="form-control-static">${profile.address}</p>
            </div>
          </div>
          
          <c:if test="${profile.vam}">
            <div class="form-group ms-form-group" style="margin-top: 20px;">
              <label class="control-label col-xs-2" style="width: 12%;" >是否VAM用户：</label>
              <div class="col-xs-2">
                <p class="form-control-static">是</p>
              </div>
              <label class="control-label col-xs-2" style="width: 12%;">所属VAM部门：</label>
              <div class="col-xs-2">
                <p class="form-control-static">${profile.departmentName}</p>
              </div>
            </div>
          
            <div class="form-group ms-form-group">
              <label class="control-label col-xs-2" style="width: 12%;">座机号码：</label>
              <div class="col-xs-2">
                <p class="form-control-static">${profile.phone}</p>
              </div>
              <label class="control-label col-xs-2" style="width: 12%;" >电子邮箱：</label>
              <div class="col-xs-2">
                <p class="form-control-static">${profile.email}</p>
              </div>
            </div>
          </c:if>
  
        </div>
      </div>
    </div>
  </div>

	<%@ include file="/WEB-INF/include/script.jsp" %>
	<d:resource type="script" root="${ctx.resource}/build" src="js/page/system/profile/profile.js"/>
	<script type="text/javascript">
	  require(['page/system/profile/profile'], function (page) {
	    page.init({
		    profileId: '${profile.id}'
		  })
	  })
	</script>

</body>
</html>